<#macro script_import>
</#macro> 
<#macro script>
</#macro> 
<#macro css_import>
</#macro> 
<#macro css>
</#macro> 
<#macro layout>
<!DOCTYPE html>
<html>
<head>
  <title>${WEB_TITLE!WEB_NAME!'欢迎光临'} - ${WEB_SUBTITLE!}</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="keywords" content="${META_KEYWORDS!}">
  <meta name="description" content="${META_DESCRIPTION!}">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="${CTPATH}/assets/css/app.css"/>
    <link rel="stylesheet" href="${CTPATH}/assets/css/nav.css"/>
   	<!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="${CPATH}/static/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="${CTPATH}/assets/font-awesome/css/font-awesome.min.css"/>
<!--   <link rel="stylesheet" href="${CTPATH}/assets/mediaelement/mediaelementplayer.css" /> -->
  <@css_import />
  <#if css ??>
  	<style type="text/css">
  	<@css />
  	</style>
  </#if>
  <script src="${CTPATH}/assets/js/jquery-2.1.1.min.js"></script>
  <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>
<#assign bootstrap_css_skin="primary">
<!-- Fixed navbar -->
  <div class="fixed-height-50">
    <nav class="navbar navbar-${bootstrap_css_skin} navbar-fixed-top">
      <div class="col-sm-12">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="${CPATH}">cnPress</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <@jp.menus>
        	<#list menus as menu>
        		<#if menu.isActive() >
        			<li class="active"><a href="${menu.url!}">${menu.title!}</a></li>
        		<#else>
        			<li><a href="${menu.url!}">${menu.title!}</a></li>
        		</#if>
        	</#list>
            </@jp.menus>
          
<!--             <li class="dropdown"> -->
<!--               <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span></a> -->
<!--               <ul class="dropdown-menu"> -->
<!--                 <li><a href="#">Action</a></li> -->
<!--                 <li><a href="#">Another action</a></li> -->
<!--                 <li><a href="#">Something else here</a></li> -->
<!--                 <li role="separator" class="divider"></li> -->
<!--                 <li class="dropdown-header">Nav header</li> -->
<!--                 <li><a href="#">Separated link</a></li> -->
<!--                 <li><a href="#">One more separated link</a></li> -->
<!--               </ul> -->
<!--             </li> -->
          </ul>
          <ul class="nav navbar-nav navbar-right">
          	<#if USER ??>
          		<li><a href="${CPATH}/user/center">${USER.nickname!USER.username}</a></li>
          		<li><a href="${CPATH}/user/logout?ucode=${ucode!}">退出</a></li>
          	<#else>
          		<li><a href="${CPATH}/user/login">登陆</a></li>
            	<li><a href="${CPATH}/user/register">注册</a></li>
          	</#if>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

  </div> <!-- /container -->
<#include "_scroll_news.html"/> 

<div class="col-sm-10">
<#nested> 
</div>
<#include "_scroll_news.html"/> 
<div class="col-sm-12">
	<footer class="text-center">
		<#include "_ads.html"/> 
	  <p>${OPTION('web_copyright')!'暂未填写版权信息'}</p>
	</footer>
</div>
<div style="display: none;">
${OPTION('jpblog_statistical_code')!}
</div>
<@script_import />
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--     <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> -->
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<!--     <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script> -->
<script type="text/javascript">
<@script />
$(window).scroll(nextPage);
var lastHeight = 0;
function nextPage(){
	var scrollTop = $(this).scrollTop();
	var scrollHeight = $(document).height();
	var windowHeight = $(this).height();
	
	if (scrollHeight - scrollTop - windowHeight < 400) {
		if(lastHeight == scrollHeight){
			return;
		}
		lastHeight = scrollHeight;
		var href = $(".pagination .next a").attr('href');
		console.log("继续加载" ,href);
		if(href != undefined && href != "javascript:;"){
			$(".page-row-hide").load($(".pagination .next a").attr('href'), function(){
				$(".page-row").append($(".page-row-hide div.col-sm-6"));
			});
		}
	}
}
</script>

</body>
</html>
</#macro>